#include "Ball.h"
//-------------------------------------------------------------------------------------------------------------
Ball::Ball ( ) {
   this->movementVector = Ogre::Vector3(0,0,0);
   this->positionVector = Ogre::Vector3(0,0,0);
}
//-------------------------------------------------------------------------------------------------------------
Ball::Ball ( Ogre::Vector3 movement , Ogre::Vector3 position) : movementVector(movement), positionVector(position) {} 
//-------------------------------------------------------------------------------------------------------------
Ball::~Ball( ) {}
//-------------------------------------------------------------------------------------------------------------
void Ball::setmovementVector( Ogre::Vector3 movement) {
   this->movementVector = movement;
   normalizeVector(this->movementVector);
}
//-------------------------------------------------------------------------------------------------------------
void Ball::setPosition( Ogre::Vector3 position) {
   this->positionVector = position;
}
//-------------------------------------------------------------------------------------------------------------
void Ball::setRadius( int radius ) {
   this->radius = radius;
}
//-------------------------------------------------------------------------------------------------------------
Ogre::Vector3 Ball::getmovementVector( ) {
   return this->movementVector;
}
//-------------------------------------------------------------------------------------------------------------
Ogre::Vector3 Ball::getPosition( ) {
   return this->positionVector;
}
//-------------------------------------------------------------------------------------------------------------
int Ball::getRadius( ) {
   return this->radius;
}
//-------------------------------------------------------------------------------------------------------------
void Ball::normalizeVector(Ogre::Vector3& vector) {
   Ogre::Real x, y, z;
   x = pow(vector.x,2);
   y = pow(vector.y,2);
   z = pow(vector.z,2);
   Ogre::Real module = sqrt(x+y+z);
   vector.x = vector.x/module;
   vector.y = vector.y/module;
   vector.z = vector.z/module;
}